package com.ssm.hj.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.hj.search.Search;
import com.ssm.hj.service.TInterposeFollowupVisitService;
import com.ssm.hj.view.MemberView;
import com.ssm.hj.view.TInterposeFollowupVisitView;
import com.ssm.mapper.TInterposeFollowupVisitMapper;
import com.ssm.pojo.TInterposeFollowupVisit;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TInterposeFollowupVisitServiceImpl implements TInterposeFollowupVisitService {
    @Resource
    private TInterposeFollowupVisitMapper tInterposeFollowupVisitMapper;
    @Override
    public PageInfo<TInterposeFollowupVisitView> queryTInterposeFollowupVisitAllService(Page<Search> page) throws Exception {
        PageHelper.startPage(page.getPageNum(), page.getPageSize());
        return new PageInfo<TInterposeFollowupVisitView>(this.tInterposeFollowupVisitMapper.queryTInterposeFollowupVisitAll(page.getSearchObj()));
    }

    @Override
    public List<MemberView> queryTInterposeSchemeAllService() throws Exception {
        return this.tInterposeFollowupVisitMapper.queryTInterposeSchemeAll();
    }

    @Override
    public int addTInterposeSchemeAllService(TInterposeFollowupVisit tInterposeFollowupVisit) throws Exception {
        return this.tInterposeFollowupVisitMapper.addTInterposeSchemeAll(tInterposeFollowupVisit);
    }
}
